home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / BTREE.ZIP / README.TXT < prev   
Encoding:
Text File  |  1994-11-15  |  1.8 KB  |  45 lines

  1. Balanced Binary Tree
  2. --------------------
  3.  
  4. These files provide several templates for managing balanced binary trees 
  5. of objects. The templates attempt to give a BIDS container class style 
  6. interface so allow them to replace any BIDS container class with minimal 
  7. changes. (I was able to change a TISetAsVector to a TIBPlusTree by only 
  8. changing the template names!)
  9.  
  10. This is a first release of the code, and is barely tested. I have 
  11. however done some testing and speed analysis comparing it to the 
  12. TSArrayAsVector class. My results showed that Finds were about the same, 
  13. but Add and Detach were many times faster for large numbers of items.
  14.  
  15. A function Search has been added. This allows a customizable search to 
  16. be performed. The compare function passed should return the following 
  17. values.
  18.  
  19. < 0    The search will take the left branch.
  20. 0    The search will end.
  21. > 0    The search will take the right branch.
  22.  
  23. Functions have been included to access, detach and destroy the first and 
  24. last items in the tree.
  25.  
  26. The iterator constructors as well as Reset, can take a start and end 
  27. value. If the start value does not exist in the tree, then the lowest 
  28. item that is greater than the start value is used. If the end value does 
  29. not exist, the greatest value that is less that the end value is used.
  30.  
  31. IÆve include both prefix and postfix ++ and -- operators for use with 
  32. the iterators.
  33.  
  34. I am distributing this code free of charge. I am not asking for anything 
  35. in return, but if you have any suggestions for improving it, or 
  36. discovered any bugs I would appreciate hearing from you.
  37.  
  38. Steve Nutt
  39. DownEast Technology
  40. CIS: 71222,423
  41.  
  42. THIS SOFTWARE IS DISTRIBUTED "AS IS" AND WITHOUT WARRANTIES AS TO 
  43. PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED 
  44. OR IMPLIED. NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
  45.